#ifndef glCanvas_h__
#define glCanvas_h__

#include "./glObject.h"
#include "./glTypes.h"

namespace GLES
{
	class Pict;
	class Canvas : public Object
	{
	public:
		enum Format
		{
			Format_none,
			Format_Default = EGL_TEXTURE_RGB
		};
		
	protected:
        Uns32 _type;
		EGLSurface _surf;
		Pict*	   _pict;
	public:
		Canvas():_surf(0),_pict(NULL){}
		EGLSurface getSurface(){return _surf;}
		Bool createSurface(SizeI& size,Uns32 format = GL_UNSIGNED_BYTE);
		Bool createWinSurface(HWND hwnd);
		Void releaseSurface();
		Bool attachPict( Pict* pict );
		Pict* detachPict();
		Pict* getPict(){return _pict;}
	};
}
#endif
